<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改检测报告基本')" />
	<link th:href="@{/css/boot.css}" rel="stylesheet" />
	<link th:href="@{/css/city-picker.css}" rel="stylesheet"  />
	<script th:src="@{/js/jquery.m.js}"></script>
	<script th:src="@{/js/boot.js}"></script>
	<script th:src="@{/js/city-picker.data.js}"></script>
	<script th:src="@{/js/city-picker.js}"></script>
	<script th:src="@{/js/main.js}"></script>
	<th:block th:include="include :: select2-css" />
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-js" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tJcJcbg-edit" th:object="${tJcJcbg}">
            <input id="reportId" name="reportId" th:field="*{reportId}"  type="hidden">
			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">报告名称：</label>
				<div class="col-sm-6">
					<input id="reportName" name="reportName" th:field="*{reportName}" class="form-control" type="text">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">报告编号：</label>
				<div class="col-sm-6">
					<input id="reportNumber" name="reportNumber" th:field="*{reportNumber}" class="form-control" type="text">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">受检单位：</label>
				<div class="col-sm-6">
					<input id="checkName" name="checkName" th:field="*{checkName}" class="form-control" type="text">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">项目名称：</label>
				<div class="col-sm-6">
					<input id="itemName" name="itemName" th:field="*{itemName}" class="form-control" type="text">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">项目地址：</label>
				<div class="col-sm-6">
					<input name="itemAddress" id="city-picker3" class="form-control" readonly type="text" th:field="*{itemAddress}" data-toggle="city-picker">
				</div>
				</div>
				<div class="col-sm-6">
					<label class="col-sm-4 control-label">行业属性：</label>
					<div class="col-sm-6">
						<select name="tradeProperty" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw')}" style="margin-bottom: 0px;">
							<option value="">请选择行业属性</option>
							<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{tradeProperty}"></option>
						</select>
					</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
					<label class="col-sm-4 control-label">防雷类别：</label>
					<div class="col-sm-6">
						<select name="thunderCategory" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_type')}" style="margin-bottom: 0px">
							<option value="">请选择防雷类别</option>
							<option th:each="dict :${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{thunderCategory}"></option>
						</select>
					</div>
				</div>
				<div class="col-sm-6">
					<label class="col-sm-4 control-label">检测周期：</label>
					<div class="col-sm-6">
						<select name="searchCycle" class="form-control m-b" th:with="type=${@dict.getType('t_jc_flzddw_time')}" style="margin-bottom: 0px">
							<option value="">请选择检测周期</option>
							<option th:each="dict :${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{searchCycle}"></option>
						</select>
					</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">联系人：</label>
				<div class="col-sm-6">
					<input id="contacts" name="contacts" th:field="*{contacts}" class="form-control" type="text">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">联系人电话：</label>
				<div class="col-sm-6">
					<input id="contactsPhone" name="contactsPhone" th:field="*{contactsPhone}" class="form-control" type="text">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测年度：</label>
				<div class="col-sm-6">
					<input id="laydate-demo-3" name="detectionYear" th:value="${#dates.format(tJcJcbg.detectionYear,'yyyy')}" class="form-control" type="text" placeholder="请选择检测年度">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测日期：</label>
				<div class="col-sm-6">
					<input id="laydate-demo-1" name="detectionDate" th:value="${#dates.format(tJcJcbg.detectionDate,'yyyy-MM-dd')}" class="form-control" type="text" placeholder="请选择检测日期">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测日期至：</label>
				<div class="col-sm-6">
					<input id="laydate-demo-2" name="detectionDateEnd" th:value="${#dates.format(tJcJcbg.detectionDateEnd,'yyyy-MM-dd')}" class="form-control" type="text" placeholder="请选择检测有效期">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测结论：</label>
				<div class="col-sm-6">
					<input id="detectionVerdict" name="detectionVerdict" th:field="*{detectionVerdict}" class="form-control" type="text">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测机构id：</label>
				<div class="col-sm-6">
					<input id="detectionId" name="detectionId" th:field="*{detectionId}" class="form-control" type="text">
				</div>
				</div>
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">检测机构名称：</label>
				<div class="col-sm-6">
					<input id="detectionName" name="detectionName" th:field="*{detectionName}" class="form-control" type="text">
				</div>
				</div>
			</div>



			<div class="form-group">
				<div class="col-sm-6">
				<label class="col-sm-4 control-label">备注：</label>
				<div class="col-sm-6">
					<input id="remark" name="remark" th:field="*{remark}" class="form-control" type="text">
				</div>
				</div>
				<div class="col-sm-6">
					<label class="col-sm-4 control-label">防雷报告统一社会信用代码：</label>
					<div class="col-sm-6">
						<input id="flzddwId" name="flzddwId" th:field="*{flzddwId}" class="form-control" type="text">
					</div>
				</div>
			</div>

		</form>
    </div>
	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>
    <script type="text/javascript">
		var prefix = ctx + "system/tJcJcbg";
		$("#laydate-demo-1").datetimepicker({
			format: "yyyy-mm-dd",
			minView: "month",
			autoclose: true
		});
		$("#laydate-demo-2").datetimepicker({
			format: "yyyy-mm-dd",
			minView: "month",
			autoclose: true
		});
		layui.use('laydate', function() {
			var laydate = layui.laydate;
			laydate.render({
				elem: '#laydate-demo-3'
				,type: 'year'
			});
		});
		$("#form-tJcJcbg-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		/*function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-tJcJcbg-edit').serialize());
	        }
	    }*/
		function submitHandler() {
			if ($.validate.form()) {
				var data = $("#form-tJcJcbg-edit").serializeArray();
				var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
				var roleIds = $.form.selectCheckeds("role");
				var postIds = $.form.selectSelects("post");
				data.push({"name": "status", "value": status});
				data.push({"name": "roleIds", "value": roleIds});
				data.push({"name": "postIds", "value": postIds});
				$.operate.saveTab(prefix + "/edit", data);
			}
		}
	</script>
</body>
</html>
